//
//  PhotoCollectionViewCell.m
//  多玩盒子
//
//  Created by 刘胜 on 16/2/29.
//  Copyright © 2016年 刘胜. All rights reserved.
//

#import "PhotoCollectionViewCell.h"
#import "UIImageView+WebCache.h"
@interface PhotoCollectionViewCell ()

@property(nonatomic,retain)UILabel * nameLable;
@property(nonatomic,retain)UIImageView * myImageView;

@end

@implementation PhotoCollectionViewCell

-(instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        [self creatView];
    }
    return self;
}

-(void)creatView {
    self.myImageView = [[UIImageView alloc] initWithFrame:self.contentView.bounds];
    [self.contentView addSubview:self.myImageView];
    //self.myImageView.backgroundColor = [UIColor redColor];
    self.nameLable = [[UILabel alloc] initWithFrame:CGRectMake(0, self.myImageView.frame.size.height - 50, self.myImageView.frame.size.width , 50)];
    self.nameLable.font = [UIFont boldSystemFontOfSize:14];
    self.nameLable.numberOfLines = 0;
    self.nameLable.alpha = YES;
    self.nameLable.backgroundColor = [UIColor yellowColor];
    [self.contentView addSubview:self.nameLable];
}
-(void)setCellModel:(TopModel *)cellModel {
    _cellModel = cellModel;
    self.nameLable.text = [NSString stringWithFormat:@"%@",_cellModel.title];
    NSURL * url = [NSURL URLWithString:_cellModel.coverUrl];
    [self.myImageView sd_setImageWithURL:url];
}

@end
